﻿#include "file_csv.h"

File_csv::File_csv(QString fname)
{
    name = fname;
    file = new QFile(name);
    b_error = file->open(QIODevice::WriteOnly|QIODevice::Append|QIODevice::Text);
}

void File_csv::write(QString data){
    file->write(data.toLatin1());
}

bool File_csv::is_empty(){
    if (file == nullptr) {
        return true;
    }
    return file->size() == 0;
}

void File_csv::writeLine(QString data){
    write(data);
    write("\n");
    file->flush();
}
